<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="Pragma" content="no-cache">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>恒巨教育后台管理系统</title>
    <link rel="stylesheet" href="../utils/layui/css/layui.css" />
    <link rel="stylesheet" href="../utils/css/pingFangFont.css">
    <link rel="stylesheet" href="../css/style.css" />
</head>

<body>
    <div class="page">
        <div class="pageLeft">
            <div class="pageLeftTitle">
                <span><img class="logo" src="../images/icon/hengjuLogo.png" alt=""> 恒巨教育后台管理系统</span>
            </div>
            <ul class="layui-nav layui-nav-tree pageLeftUl" lay-filter="test">
                <li id="openClass" class="layui-nav-item active layui-this" onclick="openPage(this)">
                    <a href="javascript:void(0)">班级管理</a>
                    <!--onclick="openPage(this)"-->
                </li>
                <li id="openCourse" class="layui-nav-item" onclick="openPage(this)">
                    <a href="javascript:void(0)">课程管理</a>
                </li>
            </ul>
        </div>
        <div class="pageRight">
            <div class="pageRightTitle">
                <span class="layui-breadcrumb breadCrumbsNav" lay-separator="/">
                    <a class="breadCrumbsNavClick" href="javascript:void(0)">班型管理</a>
                    <a><cite class="breadCrumbsNavList">添加班型</cite></a>
                </span>
            </div>
            <iframe src="classManagement.html" width="100%" height="90%" class="listTop" id="newAswer"></iframe>
        </div>
    </div>
</body>

</html>
<script src="../utils/js/jquery-3.3.1.min.js"></script>
<script src="../utils/layui/layui.all.js"></script>
<script>
    $(function () {
        $(document).on('click', '.breadCrumbsNavClick', function () {
            var text = $('.breadCrumbsNav').children().eq(0).text();
            if (text == '班级管理') {
                openPage('#openClass')
            } else if (text == '课程管理') {
                openPage('#openCourse')
            }
        })

    })
    // iframe跳转
    function openPage(obj) {
        var id = $(obj).attr("id");
        if (window.navigator.onLine == false) {
            //我们
        } else {

            // var id = $(obj).attr("id");
            if (id == "openClass") {
                $("#newAswer").attr("src", "classManagement.html");
                $("#newAswer").show();
                $('.breadCrumbsNav').children().eq(0).text('班级管理');
                $('.breadCrumbsNavList').text('添加班型');
            } else if (id == "openCourse") {
                $("#newAswer").attr("src", "courseManagement.html");
                $("#newAswer").show();
                $('.breadCrumbsNav').children().eq(0).text('课程管理');
                $('.breadCrumbsNavList').text('添加课程');
            }
        }
    }

</script>